package com.tarena.lbs.message.web.service.xxljobhandler;

import com.tarena.lbs.message.web.service.TimingMsgExecuteService;
import com.xxl.job.core.handler.IJobHandler;
import org.springframework.beans.factory.annotation.Autowired;

/**
 * xxl-job框架在定时任务到期后，回调的类，
 * 这个类的代码需要在xxl-job-admin界面中添加定时定时任务时，添加到xxl-job框架中
 *
 * 程序运行时.java文件编译成.class了，
 * 在TimingMsgGlueJobHandlerString类中定义了javaCode变量保存这个类的代码
 */
public class TimingMsgGlueJobHandler extends IJobHandler {
    @Autowired
    TimingMsgExecuteService timingMsgExecuteService;

    @Override
    public void execute() throws Exception {
        System.out.println("TimingMsgGlueJobHandler.execute()");

        timingMsgExecuteService.sendMessage(1);

    }
}
